package com.testfileupload.uploadimg.design.combination.optimization2;


import java.util.ArrayList;
import java.util.List;

public class Branch extends Corp{
    private ArrayList<Corp> subordinateList = new ArrayList<>();

    public Branch(String name, String position, int salory) {
        super(name, position, salory);
    }
    public void addSubordinate(Corp corp) {
        corp.setParent(this);
        this.subordinateList.add(corp);
    }

    public ArrayList<Corp> getSubordinate() {
        return this.subordinateList;
    }

}
